<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
	<head>
		<title>${title}</title>
		<meta charset="utf-8">
		<#include "common/reference.ftl"/>
		<#include "common/ligerui.ftl"/>
		<script type="text/javascript">
		<!--
			var ligerTable = null;
			$(function(){
				ligerTable = $('#table').ligerGrid({
					width:'98%',
					enabledSort:false,
					pageSizeOptions:[5,10,20,50,100,200],
					height:'auto',
					alternatingRow:true,
					url:'${base}/menu/getList',
					alternatingRow: false,
					pageSize:100,
					tree: {
	                    columnId: 'menuName',
	                    idField: 'menuId',
	                    parentIDField: 'parentId'
	                },
					columns:[
						{display:'菜单编号',name:'menuId',id:'menuId',align:'center'},
						{display:'菜单名称',name:'menuName',id:'menuName',align:'left'},
						{display:'菜单地址',name:'actionUrl',id:'actionUrl',align:'left'},
						{display:'图标样式',name:'iconCss',id:'iconCss',align:'center'},
						{display:'排序',name:'sortOrder',id:'sortOrder',align:'center'},
						{
							display:'是否启用',
							name:'enabled',
							id:'enabled',
							align:'center',
							render:function(row){
								var enabled = row.enabled;
						 		if(enabled){
						 			return '是';
						 		}
						 		return '否';
							}
						}
						/*
						,
						{
							display:'操 作',
							align:'center',
							render:function(row){
								var menuId = row.menuId;
								return [ 
									'<a class="edit" href="javascript:void(0)" onclick="editItem('+menuId+')"  title="编辑">',
						                '<i class="fa fa-edit"></i>',
						            '</a>',
						            '<a class="remove" href="javascript:void(0)" onclick="removeItem('+menuId+')" title="删除">',
						                '<i class="fa fa-remove"></i>',
						            '</a>'
						            ].join('');
							}
						}
						*/
					]
				});
				
				$('#btnSearch').click(function(){
					if(ligerTable){
						var menuName = $('#txtMenuName').val();
						if(menuName == '') return;
						ligerTable.setParm('menuName',menuName);
						ligerTable.reload();
					}
				});
			});
			function setFuns(menuId){
	        	var url='${base}/menufun/list/'+menuId;
	            changePage(url);
		    }
		    function editItem(menuId){
	        	var url='${base}/menu/edit/'+menuId;
	            changePage(url);
		    }
		    function removeItem(menuId){
		    	layer.confirm('确定要删除吗？',function(){
	    			$.ajax({
	            		url:'${base}/menu/remove/'+menuId,
	            		type:'POST',
	            		data:{},
	            		dataType:'json',
	            		success:function(rst){
	            			layer.msg(rst.message);
	            			if(rst.status=='OK' && ligerTable != null ){
	            				ligerTable.reload();
	            			}
	            		}
	            	});	
	    		});
		    }
		-->
		</script>		
	</head>
	<body class="${configs["skinName"]}">
		<#include "common/breadcrumb.ftl">
		<div class="widget-box">
			<div class="widget-header widget-header-flat">
				<h5 class="lighter">
					<i class="fa fa-search"></i>
					菜单查询
				</h5>
			</div>
			<div class="widget-body">
				<div class="widget-main">
					<div class="row">
						<div class="col-xs-12 col-sm-5">
							<div class="input-group">
								<span class="input-group-addon">菜单名称</span>
								<input id="txtMenuName" type="text" class="form-control search-query" placeholder="请输入菜单名称" />
								<span class="input-group-btn">
									<button id="btnSearch" type="button" class="btn btn-primary btn-sm">
										查询
										<i class="fa fa-search bigger-110"></i>
									</button>
								</span>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="widget-box">
			<div class="widget-header widget-header-flat">
				<h5 class="lighter">
					<i class="fa fa-table"></i>
					菜单列表
				</h5>
			</div>
			<div class="widget-body">
				<div id="table"><div>
			</div>
		</div>
	</body>
</html>